<?php get_instance()->view('common/header');?>
<style>
    .bg {
        background: url('<?php echo $this->staticUrl;?>img/png/s1.png') no-repeat 0 100px;
        background-size: 100%;
    }
    .regsbox {
        background: #FFFFFF;
        position: absolute;
        left: 20px;
        right: 20px;
        top: 30px;
        bottom: 30px;
        padding: 2em;
    }
    .itembox {
        border-bottom: 1px solid #e5e5e5;
        display: -webkit-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
        position: relative;
        padding: 1em 0;
        padding-left: 2em;
        font-size:14px;
    }
    .itembox .imgbox {
        height: 1.25em;
        position: absolute;
        left: 0;
    }
    .yanzheng {
        position: absolute;
        right: 0;
        padding: 0 1em;
    }
    .yanzheng a {
        line-height: 1em;
        position: relative;
    }
    .yanzheng a:after {
        content: '';
        display: block;
        width: 1px;
        background: #999;
        height: 1em;
        position: absolute;
        left: -1em;
        top: .1em;
        bottom: 0;
        /* Center slide text vertically */
        display: -webkit-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
        font-size: 1.0em;
    }
    .pubinput {
        border: 0 !important;
        width: 100%;
        position: relative;
    }
    .imgbox img {
        max-width: 100%;
        max-height: 100%;
    }
</style>
<body class="bg">
<div class="regsbox">
    <div class="imgbox wp50 m0a mb10" style="width:80%;"><img src="<?php echo $this->staticUrl;?>img/png/s2.png" alt=""></div>
    <form class="mb20" action="<?php echo getUrl('user/register')?>" id="save-form" method="post">
    <div class="itemlist">
        <div class="itembox">
            <div class="imgbox"><img src="<?php echo $this->staticUrl;?>img/png/s3.png" alt=""></div>
            <input type="text" name="mobile" class="pubinput" placeholder="请输入手机号">
        </div>
        <div class="itembox">
            <div class="imgbox"><img src="<?php echo $this->staticUrl;?>img/png/s4.png" alt=""></div>
            <input type="text" name="code" class="pubinput" placeholder="请输入验证码">
            <div class="yanzheng"><a href="javascript:;" class="lanzi">获取验证码</a></div>
        </div>
        <div class="itembox">
            <div class="imgbox"><img src="<?php echo $this->staticUrl;?>img/png/s5.png" alt=""></div>
            <input type="password" name="password" class="pubinput" placeholder="请输入密码">
        </div>
        <div class="itembox">
            <div class="imgbox"><img src="<?php echo $this->staticUrl;?>img/png/s5.png" alt=""></div>
            <input type="password" name="re_password" class="pubinput" placeholder="请确认密码">
        </div>
    </div>
    <input type="hidden" name="pid" value="<?php echo isset($pid)? $pid:'0'?>">
    <button class="kbtn" style="margin-top:2em;background:#ea5514;" href="javascript:;">注册</button>
    </form>
    <div class="imgbox m0a" style="width:80%;"><img src="<?php echo $this->staticUrl;?>img/png/s6.png" alt=""></div>
</div>
</body>

<script src="<?php echo $this->staticUrl;?>js/base.js"></script>
<script type="text/javascript">
    $(function () {
        $.e_validate.init('#save-form',{saveMessage:'保存中...'});
    })
</script>
<script>

    $(function(){

        $('.lanzi').click(function(){
            var phone = $('[name="mobile"]').val();
            if(phone == ""){
                show_message({status:0, message:'请输入手机号码'});
                return false;
            }
            var reg = /^0?1[3|4|5|7|8|9][0-9]\d{8}$/;
            if (!(reg.test(phone))) {
                show_message({status:0, message:'请输入正确的手机号码'});
                return false;
            }

            $.ajax({
                url: '<?php echo getUrl("user/getRegisterVerifyCode")?>',
                type:"POST",
                data:{
                    mobile:phone
                },

                success:function(arr){
                    if(arr.status == "1"){
                        tt = setInterval(time_show,1000);
                    }
                    show_message({status:arr.status, message:arr.message});

                    return false;
                },
                dataType:'json'
            });
        })

    });

    var time=60;
    function time_show(){
        if(time>1){
            time=time-1;
            $(".sendyzm").text(time+'s');
            $('[name="mobile"]').attr("readonly",true);
        }else{
            $(".sendyzm").text('重新获取');
            $('[name="mobile"]').attr("readonly",false);
            $('.sendyzm').attr('disabled',false);
            clearInterval(tt);
            time=60;
        }

    }
</script>
</html>